/****************************************************************************************
*                                                                                      *
*                          Projeto BioInfo - Lincs and CIn / UFPE                      *
*                                    07/10/2014                                        *
*																					   *
****************************************************************************************
* Descricao: Arquivo que contem o construtor da classe bioaplication_sw.                    *
****************************************************************************************
* Responsaveis: Jefferson Ramos(jrla)													   *
*                                                                                      */
/*                                                                                     *
****************************************************************************************/
#include <bioaplication_sw.h>



bioaplication_sw::bioaplication_sw(
									int NUM_THREADS,
									int TAMSEQ,
									int alignment_by_individuals,
									int num_individuals,
									int query_compare,
									int run_time,
									int use_gpu
									) {

	// armazena os parametros passados
	this->NUM_THREADS = NUM_THREADS;
	this->TAMSEQ = TAMSEQ;
	this->alignment_by_individuals = alignment_by_individuals;
	this->num_individuals = num_individuals;
	this->query_compare = query_compare;
	this->run_times = run_time;
	this->use_gpu = use_gpu;

	try {

		bioinfo_canonic = new Canonic (
											TAMSEQ,
											alignment_by_individuals,
											num_individuals,
											query_compare,
											run_time
											);

		bioinfo_threads = new Threads (
											NUM_THREADS,
											TAMSEQ,
											alignment_by_individuals,
											num_individuals,
											query_compare,
											run_time
											);

		bioinfo_BD = new files_BD (
										TAMSEQ,
										alignment_by_individuals,
										num_individuals
										);

		bioinfo_ocl = new Ocl (
									TAMSEQ,
									alignment_by_individuals,
									num_individuals,
									query_compare,
									run_time,
									use_gpu
									);
	}
	catch ( std::exception e ) {
		printf("ERRO: Failed to initializing Canonic, Threads and files_BD.");
		printf("\n\nPress ENTER to exit...");
		fflush(stdin);
		getchar();
		exit(-1);
	}
	catch ( ... ) {
		printf("ERRO: Failed to initializing Canonic, Threads and files_BD.");
		printf("\n\nPress ENTER to exit...");
		fflush(stdin);
		getchar();
		exit(-1);
	}

	return;
}
